// pages/index/index.js
import {
    requestUtil,
    getbaseUrl
} from "../../utils/request"

Page({

    /**
     * 页面的初始数据
     */
    data: {
        swiperImg:[
          "12.jpg",
          "11.jpg",
          "13.jpg",
          "14.jpg",
        ],
        baseUrl:'',
        swiperIndex:0,
        bgColor:[
          "linear-gradient(#feeae9,#feeae9,#fff3f3,#fff3f3)",
          "linear-gradient(#e1f5ff,#e1f5ff,#f1faff,#f1faff)",
          "linear-gradient(#fcf2e6,#fcf2e6,#fefbf4,#fefbf4)",
          "linear-gradient(#eaeaea,#eaeaea,#f7f7f5,#f7f7f5)",
      ],
      navistatu:"",
      munu:""
  
    },
    getSwiperIndex(e){
      let currentIndex = e.detail.current
      this.setData({
          swiperIndex:currentIndex
      })
  },

  backgoto(){
      wx.navigateBack({
        delta: 1,
      })
  },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        // console.log(wx.getSystemInfoSync()["statusBarHeight"]+'px')
        // console.log(wx.getMenuButtonBoundingClientRect()['height']+'px')
        this.setData({
            baseUrl:getbaseUrl()+"/image/",
            navistatu:wx.getSystemInfoSync()["statusBarHeight"]+'px',
            munu:wx.getMenuButtonBoundingClientRect()['height']+'px'
          })
        
    },
  
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {
  
    },
  
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
  
    },
  
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {
  
    },
  
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {
  
    },
  
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {
  
    },
  
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {
  
    },
  
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {
  
    }
  })